1. Field of the Invention
The invention is directed to a method for converting digital source data in the raster of a first resolution into digital target data having a second resolution according to the preamble of patent claim 1.
2. Description of the Related Art
In digital data processing, it is often necessary to convert digital image data that are present in the raster of a first resolution into target data having a second resolution. Each picture element, i.e. a point in the raster allocated to the digital value, is thereby referred to as pixel. Without gray levels, thus, a pixel corresponds to one bit. The topical resolution is thereby indicated in picture elements per inch (dots per inch, dpi). As known, one inch corresponds to 25.4 mm. The second resolution (target resolution) is usually higher than the first (source resolution). The target image in the second resolution can also contain more gray scale values per pixel than the source image instead of or in addition to the higher topical resolution.
For example, it often occurs in digital printing technology that image data are supplied by a computer in a first raster, for example in a 240 dpi raster, but are to be reproduced by a printer in a different raster, for example in a 600 dpi raster. Particularly when expanding an existing EDP system by a modern printer, it occurs that print jobs that were produced earlier comprise, for example, only masters in 240 dpi resolution. When the user wishes to use a new printer with, for example, a resolution of 600 dpi, then the print data must be correspondingly converted. The conversion should thereby ensue automatically without requiring inputs by the user.
Since half the pixels cannot be represented in playback units having discrete presentation levels such as LCD picture screens or digital printers, specific rules must be erected for conversions by factors of the resolution that are not whole-numbered.
The conversion can then ensue such that each value of the first raster is multiplied by a scaling factor SF that is prescribed by the ratio of the two resolution values of the rasters, that, thus, for example, the SF-fold set of identical values in the second raster is generated from a value in the first raster, whereby the following applies:                               S          ⁢                      xe2x80x83                    ⁢                      F            i                          =                                                                              resolution                  ⁢                                      xe2x80x83                                    ⁢                  of                  ⁢                                      xe2x80x83                                    ⁢                  the                  ⁢                                      xe2x80x83                                    ⁢                  second                                                                                                      raster                  ⁢                                      xe2x80x83                                    ⁢                  in                  ⁢                                      xe2x80x83                                    ⁢                  direction                  ⁢                                      xe2x80x83                                    ⁢                  i                                                                                                                          resolution                  ⁢                                      xe2x80x83                                    ⁢                  of                  ⁢                                      xe2x80x83                                    ⁢                  the                  ⁢                                      xe2x80x83                                    ⁢                  first                                                                                                                          xe2x80x83                                    ⁢                                      raster                    ⁢                                          xe2x80x83                                        ⁢                    in                    ⁢                                          xe2x80x83                                        ⁢                    direction                    ⁢                                          xe2x80x83                                        ⁢                    i                                                                                                          (                  Equation          ⁢                      xe2x80x83                    ⁢          1                )            
Although the data are transformed into the target raster with such a scaling procedure, the playback quality is thereby not improved.
On the other hand, the conversion of data into a raster having higher resolution in fact enables the improvement of the playback quality in that, for example, contours are more finely drawn. It is usually necessary to smooth the data for such a conversion. In known smoothing methods, smoothing parameters usually enter into the smoothing process in the form of a matrix or, respectively, of a window, whereby the weighting of neighboring picture elements of a point to be smoothed is prescribed by the values of the matrix. Given SFx=SFy, such windows are 3xc3x973 windows or 5xc3x975 windows.
A method for scaling and smoothing image data is disclosed by German Patent Document DE 195 06 792 A1. In this method, a plurality of sets of pixel patterns or, respectively, Boolean calculating operations allocated to them are provided, with reference whereto the conversion ensues. For conversion, a matrix of source image data having, for example, 7xc3x977 picture elements is subjected to the basic calculating operations and the target image data are acquired therefrom. When scaling the image data xe2x80x9cupxe2x80x9d (SF greater than 1), a respective group of target pixels is allocated to a group of source pixels. The calculating operations are configured such that the same number of high-resolution pixels are removed as added on average in the conversion. What is thereby achieved is that the degree of blackening of an overall image is essentially preserved.
What is disadvantageous about this method is that the conversion ensues only in groups with respect to the source pixels. Given, in particular, a scaling factor that is not whole-numbered (a broken scaling factor), one of the target pixels ("PHgr") can then only be optionally allocated to a cluster of neighboring target pixels, i.e. relatively unmotivated, and cannot be unambiguously allocated to a source pixel. In addition, the allocation must be defined in advance in corresponding method rules.
A method for converting digital image data from a first raster into a second raster that is suitable for non-whole-numbered scaling factors is also disclosed by German Patent Application 197 13 079.8. This method likewise works region-oriented. A target region is thereby allocated to each source region, whereby the two regions having the same position in the overall image. Boolean calculating rules are prescribed within the target region, the conversion ensuing in conformity with these rules.
Another procedure for scaling and smoothing image data is disclosed by European Patent Document EP 506 379 B1 as well as by U.S. Pat. No. 5,270,836. Two steps for scaling and smoothing are provided in this procedure. As schematically shown in FIG. 1, a source image 1 that is present in a source raster is scaled in a first step 2 given this procedure, as a result whereof an intermediate image 3 arises in the target raster. The smoothing in the target raster is implemented on the basis of this intermediate image in the second step 4, as a result whereof the target 5 arises.
What is disadvantageous about the above-described procedure is that a plurality of data in the target raster must be respectively taken into consideration for the smoothing. Due to the relatively great number of memory accesses and calculating operations that are thereby required, the outlay connected therewith is relatively high and is therefore hardly suited for applications such as high-performance printing systems wherein the speed of the conversion is crucial. A realization of the method on the basis of software thus likewise seems hardly possible.
A scaling and smoothing of transmission data can also be necessary in the field of telefax transmission when the data, for example, are received in a first resolution but are stored, forwarded or are to be printed out in a different resolution. A corresponding method for this application is disclosed, for example, by U.S. Pat. No. 5,394,485 A.
Another method for converting image data is disclosed by German Patent Document DE 42 06 277 A1. Only a raster conversion but no smoothing of the image data ensues given this method. European Patent Document EP 708 415 A2 likewise discloses a method for converting image data that, however, is only suitable for whole-numbered scaling factors. European Patent Document EP 0 006 351 A1 discloses an image processing system that works with look-up tables. U.S. Pat. No. 5,657,430 A discloses a method for converting vector fonts onto gray scale bit maps.
U.S. Pat. No. 5,646,741 discloses a method and an apparatus wherein image signals are scaled and smoothed. A check according to predetermined criteria is thereby carried out in the source region to see whether a smoothing should be implemented and the source image signals potentially smoothed. The smoothed image signals are smoothed thereafter.
PCT Published International Application WO-A-96/16380 discloses a system and a method for the interpolation of image signals. A rule is thereby respectively selected from a plurality of interpolation rules. The source image signals are then processed in a plurality of successive steps. In a first step, the image signals are interpolated line-by-line on the basis of a selected, line-related rule. In a second step, the image signals are then interpolated column-by-column on the basis of a second, column-related rule. Finally, the line image signals and the column image signals are compiled in pages by a formatting unit.
An object of the method is to provide a method for converting digital image data from a first raster into a second raster that leads to a high processing speed and that implements both a scaling as well as a smoothing of the image data.
This object is achieved by the invention of a method for converting digital source data referring to source pixels in the raster of a first resolution into digital target data in the raster of a second resolution, including the data are scaled by at least one scaling factor, each source datum having a target image matrix allocated to it on the basis of a surround window surrounding the source pixel and the target data being determined from neighboring target image matrices such that each target pixel is directly formed from a source pixel taking the surroundings thereof into consideration, each source datum being employed for smoothing the target data to be determined from all neighboring source data, and the scaling and the smoothing being implemented in a common processing step such that the target data are smoothed in the raster of the source data. In a further embodiment, the method for converting digital source data in the raster of a first resolution into digital target data in the raster of a second resolution, includes the data being scaled by a scaling factor and being smoothed, a scaling rule being prescribed from a plurality of selectable scaling rules, a smoothing rule being prescribed from a plurality of smoothing rule, a single scaling and smoothing rule being formed from the selected scaling rule and the selected smoothing rule, both a smoothing of the target data in the raster of the source data as well as a scaling ensuing in respectively one processing step with said single scaling and smoothing rule during the formation of the target data, each source datum having a target image matrix allocated to it on the basis of a surround window surrounding the source pixel and the target data being determined from neighboring target image matrices such that each target pixel is directly formed from a source pixel taking the surroundings thereof into consideration, each source datum being employed for smoothing the target data to be determined from all neighboring source data.
According to a first aspect of the invention, the data are scaled by at least one scaling factor and a target image matrix is allocated to each source datum by individual pixels, i.e.xe2x80x94pixel-individually with respect to the source pixels, on the basis of a surround window surrounding the source pixel. The target data are determined from neighboring target image matrices, whereby the data are smoothed in the raster of the source data. Each source datum is thus employed for smoothing all neighboring source data.
According to the first aspect of the invention, the smoothing of the data is implemented in the raster of the source data and not in the target raster. A significantly faster data processing given two-dimensional image data is thus possible than given comparable methods that implement the smoothing in the target raster because the data set onto which the smoothing function is applied is significantly smaller. This processing speed is approximately lower by the square of the scaling factor SF for the case of identical scaling factors in x-direction and in y-direction (SF=SFx=SFy). The first aspect of the invention is particularly suitable for the conversion of image data given a non-whole-numbered broken) scaling factor. Due to the processing based on individual pixels, the advantage over previously known methods is achieved that the processing of the data given broken scaling factor can ensue nearly analogous to the processing given whole-numbered scaling factor. The first aspect of the invention is based on the perception that the same result can be achieved with a smoothing in the source raster as with a smoothing that is applied to a significantly greater plurality of data in the target raster because the structures to be smoothed are already to be defined from the source image. The scaling of an image by a factor greater than one in fact increases the plurality of pixels to be smoothed; the informational content of the bit map on which the image is based, however, remains unmodified. Tests have shown that a smoothing with rules that erected in the target raster does not yield different results than when corresponding rules for smoothing are already erected on the basis of the data in the source raster.
It is also perceived that the time required for the smoothingxe2x80x94in a first approximation (i.e., without taking the image edges into consideration)xe2x80x94is directly proportional to the size of the image, and the processing of the data in the source raster can therefore ensue faster than the processing of the data in the target raster.
Proceeding from the known prior art, in particular, it was perceived that a general smoothing method in the target region is based on the existence of all pixel combinations. Since, however, the pixels were highly scaled, there are only a limited plurality of variation possibilities. The informational content of the pixels is not increased by scaling-up. The time required for processing the data can be reduced by the square of the scaling factor as a result of the inventive smoothing of the image data in the source raster compared to methods that smooth in the target raster.
A smoothing with the data of the source image as basis also enables a smaller size of the recognition matrix. Given a scaling factor of 2, a recognition matrix of 3xc3x973 in the source region, for example, achieves the same quality as a 5xc3x975 recognition matrix that is applied in the target region. The result thereof is that only 3xc3x973=9 pixels need be taken into consideration for the recognition in the source region instead of 5xc3x975=25 pixels in the target region. The processing speed of the invention method given direct logical evaluation (in hardware or software) is thus increased in two respects: first, fewer data are to be interpreted in the source raster than in the target raster; second, the size of the smoothing window can be reduced in the source raster. The processing speed is then higher by a factor of up to 25/9xc3x97SFxxc3x97SFy than in conventional methods. The logical outlay, for example for gate functions, is reduced by this factor. A table having 512 entries is needed for a 3xc3x973 matrix given a realization with look-up tables, which are often utilized in software solutions for performance-enhancement because the bit-by-bit logical interpretation is thereby eliminated and the result is directly obtained from the table. In contrast, this table must have a size of 33554432 entries (32 MB) given a 5xc3x975 matrix. A table of this size is no longer acceptable in practice.
The invention also enables both the function of the smoothing as well as that of the scaling to be implemented in a single step, in that the overall method is implemented in the raster of the source data. The method can thereby be implemented independently of the size of the respective scaling factor. The scaling factor can be both whole-numbered as well as fractional.
In a second aspect of the invention, digital source data in the raster of a first resolution are scaled by a scaling factor and smoothed into digital target data in the raster of a second resolution. A scaling rule is thereby prescribed and a specific smoothing rule is prescribed from a plurality of smoothing rules. The two prescribed rules are then merged such to form a combined scaling and smoothing rule that the smoothing ensues in the raster of the source data, whereby each source datum is employed for smoothing a plurality of neighboring source data. The scaling factor is, in particular, not a whole number and can be presented by a fraction of whole numbers.
A high degree of flexibility in the processing of image data is achieved by the second aspect of the invention. Particularly given a conversion of the method with a software program, a plurality of smoothing and/or scaling methods can thereby be freely combined with one another, and one can react very flexibly to the greatest variety of print data and printer resolutions when printing images. Individual (job-specific) scaling and/or smoothing rules can thereby already be prescribed or selected either in the print job or in the printer device, for example by an operator.
In a third aspect of the invention, it is not only binary data (black-and-white) that are processed; rather, grayscale values or color values covering a plurality of bits or bytes are processed per picture element. It is thereby possible, on the one hand, to implement a xe2x80x9cgrayscale conversionxe2x80x9d wherein the raster refers to gray scales and, thus, a conversion from a first grayscale raster into a second grayscale raster is undertaken per picture element, for example 4 bit grayscale values corresponding to 16 gray scales onto 6-bit grayscale values corresponding to 64 gray scales are scaled up. A grayscale smoothing can thereby also ensue in that more finely graduated grayscale transitions are generated between the picture elements in the target space. On the other hand, it is thereby also possible to convert the picture elements in the location space (i.e., in the dots per inch raster) affected with grayscale values into a finer location space raster upon retention of the grayscale resolution. Analogous to these gray scale conversion versions, color scale conversions, for example a scaling-up from a 32 color bit raster into a more highly resolved 48 color bit raster, can also ensue. A color smoothing analogous to the grayscale smoothing can also be implemented as a result thereof.
The scalings and smoothings in the location space, in the grayscale space and in the color space can thereby be arbitrarily combined with one another.
In a fourth aspect of the invention, the processing of the data ensues byte-oriented. A binary information can thereby respectively be allocated to a plurality of picture elements and the data can be processed parallel. However, gray scales and/or color values can also be allocated to the picture elements (pixels), these in turn comprising a plurality of bits or bytes per pixel. A byte-by-byte processing has a positive effect on the processing speed because digital electronic components, particularly in the field of information processing, likewise internally process the data byte-by-byte and because this byte format is a generally standard memory format.
With every processing clock, the data are thereby shifted in a register by a specific plurality of positions dependent on the height of the smoothing window; after storing a corresponding plurality of bytes (for example, 3 bytes for a processing of 3 lines with 8 pixels each on which a 3xc3x973 smoothing window should respectively act), neighboring data represent an index. This index can be directly employed for addressing a corresponding smoothing matrix (for example, 3xc3x973), whereby the addressing acts either as input signal of a hardware circuit or acts directly on a look-up table within a computer software. The two-dimensional objective of processing image data is thereby converted into a one-dimensional task.
In a preferred exemplary embodiment, a shift register having respectively n bytes per line is filled per processing clock according to the following rules:
RO through R(Axe2x88x921) remain unaffected (Rule 1) and
R(i+A)=q(i/Qy, Qyxe2x88x921xe2x88x92(i%Qy)) or
R(i+A)=q(i/Qy, i%Qy) (Rule 2),
whereby the following apply:
Ri: value of the ith register pixel;
Qx: window width in x-direction
Qy: window width in y-direction
q(k,l): value of the source pixel with the position (k,l)
/: integer division
%: modulo division and
A=Wxc3x97(Qyxc3x97(Qxxe2x88x921)). The shift register thereby has a width B=Qyxc3x97Wxc3x97((8n/W)xe2x88x921+Qx), whereby 8n/W is whole-numbered, with
W: value of a pixel, i.e. bits per pixel (binary, grayscale value, color value)
B: width of the shift register in bits
for W=1(binary data), B=Qyxc3x97(8nxe2x88x921+Qx) is obtained.
It has been shown that the inventive methodxe2x80x94particularly given a realization in the form of a software program on a computerxe2x80x94runs significantly faster than comparable methods that first implement a scaling, deposit the result in an intermediate memory and only then implement the smoothing at the intermediately stored data, i.e. in the target raster. What is advantageous given a conversion with software is that the switching can ensue highly suited to need within a print job xe2x80x94when a conversion is required, this ensues with the corresponding modules of the conversion program. When no conversion is required, then the data are forwarded without having been processed by the conversion program. The flexibility can thus be enhanced to such an extent that different resolutions can even be processed within one document to be printed out, i.e. within one page. Whereas, for example, text having a resolution of 300 dpi has a good effect, it is usually expedient to select a resolution of 600 dpi or higher in the reproduction of images.
In the smoothing, it can be necessary to distinguish between image information and text information and to respectively undertake different or, respectively, no smoothing, for example in order to avoid Moirxc3xa9 effects. When the invention is applied in a software, then the advantage can be achieved that no outlay is required for distinguishing between texts and images within a print job. This information is often already contained in the print job in the form of different object identifiers and can be employed for setting the smoothing rules.
The scaling and smoothing can ensue in a common step with a look-up table that contains data for both procedures. The source data are thereby preferably directly employed for addressing the look-up table.